package com.intpro.demo.Utils;

public class CodeException extends Exception
{

	public long code;

	public CodeException(long code, String msg)
	{
		super(msg);
		this.code = code;
	}

	public static CodeException AuthorizationErr()
	{
		return new CodeException(101, "请先登录");
	}

	public static CodeException TokenErr()
	{
		return new CodeException(102, "token错误");
	}

	// 103 注册时字段格式错误

	public static CodeException NotNullErr()
	{
		return new CodeException(104, "不能为空");
	}

	public static CodeException EmailRepeatErr()
	{
		return new CodeException(105, "用户名或者手机号重复");
	}

	public static CodeException PasswordErr()
	{
		return new CodeException(106, "用户名或者密码错误");
	}

	public static CodeException FileUploadErr()
	{
		return new CodeException(107, "文件上传错误");
	}

	public static CodeException NoUserErr()
	{
		return new CodeException(108, "没有这个用户");
	}

	public static CodeException PhoneRepeatErr()
	{
		return new CodeException(109, "手机号已被使用");
	}
	public static CodeException CodeCreateErr()
	{
		return new CodeException(110, "验证码创建失败");
	}
	public static CodeException CodeCheckErr()
	{
		return new CodeException(111, "验证码错误");
	}
	public static CodeException NoCheckErr()
	{
		return new CodeException(112, "没有验证");
	}
}

